<!DOCTYPE html>
<html>
<head>
    <title>区表</title>
    #parse("sys/header.html")
</head>
<body>
<div id="rrapp" v-cloak>
	<div v-show="showList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
                <i-button @click="reloadSearch">重置</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("addressarea:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("addressarea:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("addressarea:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
	    <table id="jqGrid"></table>
	    <div id="jqGridPager"></div>
    </div>

    <Card v-show="!showList">
        <p slot="title">{{title}}</p>
		<i-form ref="formValidate" :model="addressArea" :rules="ruleValidate" :label-width="80">
            <Form-item label="区编号" prop="code" style="width: 445px;">
                <i-input v-model="addressArea.code" placeholder="区编号"/>
            </Form-item>
            <Form-item label="城市编号" prop="cityCode" style="width: 1000px;">
                <div style="display: flex">
                    <Cascader :data="addressList" v-model="selectAddresses" @on-change="handleChange" style="width: 250px;"></Cascader>
                    <i-button type="success" shape="circle" icon="ios-reload" @click="vm.getAddressList()">刷新</i-button>
                    <i-button type="primary" shape="circle" icon="plus-circled" @click="vm.goToAddressProvinceList()">去添加省份</i-button>
                    <i-button type="primary" shape="circle" icon="plus-circled" @click="vm.goToAddressCityList()">去添加城市</i-button>
                </div>
            </Form-item>
            <Form-item label="区名称" prop="name" style="width: 445px;">
                <i-input v-model="addressArea.name" placeholder="区名称"/>
            </Form-item>
            <Form-item label="区简称" prop="shortName" style="width: 445px;">
                <i-input v-model="addressArea.shortName" placeholder="区简称"/>
            </Form-item>
            <Form-item label="合并全称" prop="mergerName" style="width: 445px;">
                <i-input v-model="addressArea.mergerName" placeholder="合并全称，逗号隔开"/>
            </Form-item>
            <Form-item label="邮政编码" prop="zipCode" style="width: 445px;">
                <i-input v-model="addressArea.zipCode" placeholder="邮政编码"/>
            </Form-item>
            <Form-item label="经度" prop="longitude" style="width: 445px;">
                <i-input v-model="addressArea.longitude" placeholder="经度"/>
            </Form-item>
            <Form-item label="纬度" prop="latitude" style="width: 445px;">
                <i-input v-model="addressArea.latitude" placeholder="纬度"/>
            </Form-item>
            <Form-item label="排序" prop="sort" style="width: 300px;">
                <i-input v-model="addressArea.sort" placeholder="排序（越小排越前）"/>
            </Form-item>
            <Form-item>
                <i-button type="primary" @click="handleSubmit('formValidate')">提交</i-button>
                <i-button type="warning" @click="reload" style="margin-left: 8px"/>返回</i-button>
                <i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>
            </Form-item>
        </i-form>
	</Card>
</div>

<script src="${rc.contextPath}/js/lht/addressarea.js?r=_${date.systemTime}"></script>
</body>
</html>